package com.ithei.多线程第二天.线程池;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Demo3 {
    public static void main(String[] args) {
        ExecutorService pool = Executors.newFixedThreadPool(10);
//        pool.submit(()->{
//            System.out.println(Thread.currentThread().getName()+":  1");
//        });
//        pool.submit(()->{
//            System.out.println(Thread.currentThread().getName()+":  2");
//        });
        for (int i = 0; i < 100; i++) {
            pool.submit(()->{
                System.out.println(Thread.currentThread().getName()+":  3");
            });
        }
        pool.shutdown();

    }
}
